package com.cskaoyan.bean.order;

import lombok.Data;

import java.util.Date;

/**
 * @ClassName:HandelOption
 * @Description:TODO
 * @author:leiwenjie
 * @date:2022/9/12 10:14
 * @version:1.0
 */
@Data
public class HandleOption {

    private boolean aftersale = false;

    private boolean cancel = false;

    private boolean comment = false;

    private boolean confirm = false;

    private boolean delete = false;

    private boolean pay = false;

    private boolean rebuy = false;

    private boolean refund = false;

    public static HandleOption data(short status) {
        HandleOption data = new HandleOption();
        switch (status) {
            case 101:
                data.setDelete(true);
                data.setCancel(true);
                break;
            case 102:
                data.setDelete(true);
                break;
            case 103:
                data.setDelete(true);
                break;
            case 201:
                data.setRefund(true);
                break;
            case 202:
                data.setRefund(true);
                break;
            case 203:
                data.setDelete(true);
                break;
            case 301:
                data.setConfirm(true);
                break;
            case 401:
                data.setDelete(true);
                data.setComment(true);
                data.setRebuy(true);
                data.setAftersale(true);
                break;
            case 402:
                data.setDelete(true);
                data.setComment(true);
                data.setRebuy(true);
                data.setAftersale(true);
                break;
            case 403:
                data.setDelete(true);
                data.setRebuy(true);
                data.setAftersale(true);
                break;
        }
        return data;
    }


}
